package schoolword;

import java.io.*;

public class Text1 {
    public static void main(String[] args) throws IOException {
        File file1 = new File("D:\\tuhua\\原图片.png");
        File file2 = new File("D:\\tuhua\\复制图片.png");
        FileInputStream fis = new FileInputStream(file1);
        FileOutputStream fos = new FileOutputStream(file2);
        try {
            int i = fis.read();
            while (i != -1) {
                fos.write(i);  //写
                i =  fis.read();
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            fis.close();
            fos.close();
        }
    }
}
